import http from "@/utils/http.js"

const url = {
    // 查询设备列表
    queryFacility: "/facility/queryFacility",
    // 查询设备概况信息
    facilitySituation: "/facility/facilitySituation/",
    // 录入设备信息
    insertFacility: "/facility/insertFacility",
    // 录入设备信息
    fileUpload: "/facility/fileUpload",
    // 查询各分厂的设备分类
    getFacilitySort: "/facility/getFacilitySort/",
    // 导出设备信息
    exportFacility: "/facility/exportFacility",
    // 修改设备信息
    updateFacility: "/facility/updateFacility",
    // 批量录入设备信息
    batchInsertFacility: "/facility/batchInsertFacility",
    // 批量修改设备信息
    batchUpdateFacility: "/facility/batchUpdateFacility",
    // 查询设备的联网推送数据详情
    getFacilityDetail: "/facility/getFacilityDetail",
    // 查询设备详情
    facilityDetailId: "/facility/detail/",
    // 删除设备详
    facilityDeleteId: "/facility/delete/",
    // 设备导入
    importFacility: "/facility/importFacility",


    /****************** 设备接口 *********************/
    /********** 设备维修接口 **********/
    // 查询维修任务
    equipRepairQueryRepairRecord: "/equipRepair/queryRepairRecord",
    // 转维修
    equipRepairConvertRepair: "/equipRepair/convertRepair",
    // 查询维修任务/台账
    equipRepairQueryRepair: "/equipRepair/queryRepair",
    // 导出维修台账
    equipRepairExportRepair: "/equipRepair/exportRepair",
    // 处理
    equipRepairProcessing: "/equipRepair/processing",
    // 批量验收
    equipRepairBatchAcceptance: "/equipRepair/batchAcceptance",
    // 填报
    equipRepairReportRepair: "/equipRepair/reportRepair",

    /********** 设备保养接口 **********/
    // 查询设备保养计划列表
    upkeepPlanQueryPlan: "/upkeepPlan/queryPlan",
    // 新增设备保养计划
    upkeepPlanAddPlan: "/upkeepPlan/addPlan",
    // 编辑设备保养计划
    upkeepPlanEditPlan: "/upkeepPlan/editPlan",
    // 删除设备保养计划
    upkeepPlanDeletePlan: "/upkeepPlan/delete/",
    // 查询设备保养计划详情
    upkeepPlanGetById: "/upkeepPlan/getById/",
    // 任务保养
    // 查询设备保养任务
    upkeepTaskQueryTask: "/upkeepTask/queryTask",
    // 任务更新
    upkeepTaskUpdateTask: "/upkeepTask/updateTask",
    // 调整保养任务
    upkeepTaskAdjustTask: "/upkeepTask/adjustTask",
    // 批量验收
    upkeepTaskBatchAcceptance: "/upkeepTask/batchAcceptance",
    // 导出保养台账
    upkeepTaskExportUpkeep: "/upkeepTask/exportUpkeep",
    // 填报任务
    upkeepTaskReportTask: "/upkeepTask/reportTask",
    // 导出保养记录
    upkeepTaskExportUpkeepRecord: "/upkeepTask/exportUpkeepRecord",
    // 查看图片
    fileInfoGetByIds: "/fileInfo/getByIds/",
    // 下载模板接口
    facilityDowmloadTemplate: "/facility/dowmloadTemplate",

    // 导出单台设备维修记录
    equipRepairExportSingleRepair: "/equipRepair/exportSingleRepair",
}

export default {
    url: url,
    // 查询设备列表
    queryFacility(params) {
        return http.post(url.queryFacility, params)
    },
    // 查询设备概况信息
    facilitySituation(params) {
        return http.post(url.facilitySituation + params)
    },
    // 录入设备信息
    insertFacility(params) {
        return http.post(url.insertFacility, params)
    },
    // 导入大屏所有模块
    fileUpload(params) {
        return http.post(url.fileUpload, params, 'formData')
    },
    // 查询各分厂的设备分类
    getFacilitySort(params) {
        return http.post(url.getFacilitySort + params)
    },
    // 导出设备信息
    exportFacility(params) {
        return http.export(url.exportFacility, params, 'post')
    },
    // 修改设备信息
    updateFacility(params) {
        return http.post(url.updateFacility, params)
    },
    // 批量录入设备信息
    batchInsertFacility(params) {
        return http.post(url.batchInsertFacility, params)
    },
    // 批量修改设备信息
    batchUpdateFacility(params) {
        return http.post(url.batchUpdateFacility, params)
    },
    // 查询设备的联网推送数据详情
    getFacilityDetail(params) {
        return http.post(url.getFacilityDetail, params)
    },
    // 查询设备的联网推送数据详情
    facilityDetailId(params) {
        return http.post(url.facilityDetailId + params)
    },
    // 删除设备
    facilityDeleteId(params) {
        return http.post(url.facilityDeleteId + params)
    },
    // 设备导入
    importFacility(params) {
        return http.post(url.importFacility, params, 'formData')
    },

    /****************** 设备接口 *********************/
    /********** 设备维修接口 **********/
    // 查询维修任务
    equipRepairQueryRepairRecord(params) {
        return http.post(url.equipRepairQueryRepairRecord, params)
    },
    // 转维修
    equipRepairConvertRepair(params) {
        return http.post(url.equipRepairConvertRepair, params)
    },
    // 查询维修任务/台账
    equipRepairQueryRepair(params) {
        return http.post(url.equipRepairQueryRepair, params)
    },
    // 导出维修台账
    equipRepairExportRepair(params) {
        return http.export(url.equipRepairExportRepair, params, 'post')
    },
    // 处理
    equipRepairProcessing(params) {
        return http.post(url.equipRepairProcessing, params)
    },
    // 验收
    equipRepairBatchAcceptance(params) {
        return http.post(url.equipRepairBatchAcceptance, params)
    },
    // 填报
    equipRepairReportRepair(params) {
        return http.post(url.equipRepairReportRepair, params)
    },

    /********** 设备保养接口 **********/
    // 查询设备保养计划列表
    upkeepPlanQueryPlan(params) {
        return http.post(url.upkeepPlanQueryPlan, params)
    },
    // 新增设备保养计划
    upkeepPlanAddPlan(params) {
        return http.post(url.upkeepPlanAddPlan, params)
    },
    // 编辑设备保养计划
    upkeepPlanEditPlan(params) {
        return http.post(url.upkeepPlanEditPlan, params)
    },
    // 删除保养计划
    upkeepPlanDeletePlan(params) {
        return http.delete(url.upkeepPlanDeletePlan + `${params.id}`)
    },
    // 查询保养计划详情
    upkeepPlanGetById(params) {
        return http.get(url.upkeepPlanGetById + `${params}`)
    },
    // 保养任务
    // 查询保养任务列表
    upkeepTaskQueryTask(params) {
        return http.post(url.upkeepTaskQueryTask, params)
    },
    // 任务更新
    upkeepTaskUpdateTask(params) {
        return http.post(url.upkeepTaskUpdateTask, params)
    },
    // 调整保养任务
    upkeepTaskAdjustTask(params) {
        return http.post(url.upkeepTaskAdjustTask, params)
    },
    // 批量验收
    upkeepTaskBatchAcceptance(params) {
        return http.post(url.upkeepTaskBatchAcceptance, params)
    },
    // 导出保养台账
    upkeepTaskExportUpkeep(params) {
        return http.export(url.upkeepTaskExportUpkeep, params, 'post')
    },
    // 填报任务
    upkeepTaskReportTask(params) {
        return http.post(url.upkeepTaskReportTask, params)
    },
    // 导出保养记录
    upkeepTaskExportUpkeepRecord(params) {
        return http.export(url.upkeepTaskExportUpkeepRecord, params, 'post')
    },
    // 查看图片
    fileInfoGetByIds(imageIds) {
        return http.post(url.fileInfoGetByIds + imageIds)
    },
    // 下载模板接口
    facilityDowmloadTemplate() {
        return http.post(url.facilityDowmloadTemplate)
    },
    // 导出维修记录
    equipRepairExportSingleRepair(params) {
        return http.export(url.equipRepairExportSingleRepair, params, 'post')
    },
}